#include <stdio.h>
#include "ofc/DDouble.h"

int main(int argc, char *argv[])
{
  DDouble *db1  = [DDouble alloc];
  DDouble *db2  = [DDouble new  ];
  DText   *str;

  [db1 init :7.0];                     // Init with a value
  
  [db2 set :14.0];                     // Set with a value

  str = [db1 toText];
  printf("Double1 is:%.1f and \"%s\".\n", [db1 get], [str cstring]);
  [str free];

  if ([db1 compare :db2] == 0)
    printf("Double1 is equal to double2.\n");
  else
    if ([db1 compare :db2] < 0)
      printf("Double1 is smaller than double2.\n");
    else
      printf("Double1 is greater than double2.\n");

  [db1 free];                          // Cleanup
  [db2 free];

  return 0;
} 
  
